<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:insert="~{include :: header('新增用户')}" />
    <th:block th:insert="~{include :: datetimepicker-css}" />
</head>
<body class="hold-transition">
<div class="container-fluid mt-2 mb-2">
        <form class="form-horizontal m" id="form-user-add">
            <div class="form-group row" style="margin-top: 30px">
                <label class="col-sm-2 col-form-label is-required text-sm-right">手机号</label>
                <div class="col-sm-6">
                    <input name="mobile" class="form-control" type="text" required >
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label is-required text-sm-right">账号</label>
                <div class="col-sm-6">
                    <input name="loginName" class="form-control" type="text" required >
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label is-required text-sm-right">用户名</label>
                <div class="col-sm-6">
                    <input name="userName"  class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label text-sm-right">邮箱号</label>
                <div class="col-sm-6">
                    <input name="email" class="form-control" type="text" >
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label text-sm-right">性别</label>
                <div class="col-sm-8" >
                    <label style="margin-right: 20px" class="form-radio" th:each="dict, i: ${@dict.getType('qdx_user-sex')}">
                        <input type="radio" th:id="${dict.dictCode}" name="sex" th:value="${dict.dictValue}" th:checked="${i.index == 2}" required>
                        <span th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></span>
                    </label>
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label text-sm-right">年龄</label>
                <div class="col-sm-4">
                    <input name="age" value="0" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label text-sm-right">状态</label>
                <div class="col-sm-4">
                    <select name="isAvailable" class="form-control m-b" th:with="type=${@dict.getType('qdx_user_state')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
        </form>
    </div>
    <th:block th:insert="~{include :: footer}" />
    <th:block th:insert="~{include :: datetimepicker-js}" />
    <script type="text/javascript">
        var prefix = "/user";
        $("#form-user-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add.json", $('#form-user-add').serialize());
            }
        }

        $("input[name='lastSystemTime']").datetimepicker({
            format:'Y-m-d',
            formatDate:'Y-m-d',
            timepicker:false
        });
    </script>
</body>
</html>